fix(products): per-chain chips show real leadership only, with the denominator - #2279
Merged
Conversation
…nominator Two problems on /products/[slug], both visible on Serialized. rankPerChainForBench only holds one real per-chain fact: the leader, from bestPerChain. For every other provider it reused the unfiltered aggregate order shifted by one slot, so a chip reading "#3 on Solana" was the global rank with a chain label on it, repeated identically across every chain of the bench. That reads as a measurement and is not one. Non-leader chips are gone: a chip now means "leads this chain", and its absence means "does not lead", not "ranks lower". The chips also hid how many providers were measured on the chain. "#1 on Solana" was #1 of 2 on bench 008 while sitting next to "#3 of 8" for the aggregate. They now read "#1 of 4 on Ethereum", with the denominator taken from providersPerChain and omitted when that set is unknown rather than substituting the global count. Wins accounting is unchanged: it already counted rank === 1 entries only. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spotted on
/products/serialized: the row for bench 008 reads#3 OF 8for the aggregate and then#1 ON ETHEREUM · #1 ON SOLANA · #1 ON BNB CHAIN · #1 ON BASE · #1 ON ARBITRUM. Both halves are defensible on their own, and together they mislead in two different ways.1. Non-leader chips were not per-chain measurements
rankPerChainForBenchholds exactly one real per-chain fact: the leader, frombestPerChain(one Prom roundtrip per chain, done in spec.ts). For everyone else it reused the unfiltered aggregate order, shifted one slot when the leader sat below them:So a chip reading
#3 on Solanawas the provider's global rank with a chain label attached, identical across every chain of the bench. The function's own docstring called this "a soft signal", but nothing in the rendered chip said so, and it sits directly beside chips that are real.Non-leader chips are removed. A chip now means "leads this chain"; its absence means "does not lead here", never "ranks lower here".
2. The denominator was hidden
Per-chain fields on bench 008, checked against the live staging API:
#1 ON SOLANAwas #1 of 2, rendered in the same style as a win over a crowded field, next to#3 OF 8. Chips now read#1 of 4 on Ethereum.totalRankedcomes fromprovidersPerChain; when the bench has not stashed that set the denominator is omitted rather than backfilled with the global count, which would be a different number under the same label.Not changed
Wins accounting already counted
rank === 1entries only, sowinsandchainWinsare untouched. The bench page chain tabs remain the authoritative per-chain view.237 tests pass, typecheck clean, eslint clean on the three touched files (the repo's pre-existing lint errors instacked-share-chart.tsxandtime-series-chart/are unrelated and also fail ondev).🤖 Generated with Claude Code